<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>momentjs</title>
    <script src="moment.min.js"></script>
</head>
<body>
<h1>momentjs test</h1>
<script>
    var now = moment();
    console.log(now.format().toString());
    console.log(moment("1995-12-25").format().toString());
    console.log(moment("2010-10-20 4:30","YYYY-MM-DD HH:mm").format().toString());
    console.log(moment(1318781876406).format().toString());
    console.log(moment(new Date(2011, 1-1, 16)).format().toString());
    var a = moment([2012]);
    var b = moment(a);
    a.year(2000);
    console.log(a.year()+","+b.year());
    var m = moment("2011-10-10T10:20:90");
    m.isValid(); // false
    m.invalidAt(); // 5 for seconds
    /**
     *0 years
     *1 months
     *2 days
     *3 hours
     *4 minutes
     *5 seconds
     *6 milliseconds
     */
    console.log(m.isValid()+","+m.invalidAt());
    console.warn(moment().date());
    console.log(moment().day(7));
    console.log(moment().format("YYYY MM DD"));
    console.log(moment().format("YYYY-MM-DD"));
    console.log(moment().format("YYYY/MM/DD"));
    console.log(moment("2011-10-10").format("YYYY,MM,DD"));
    var t = moment("2011-10-10");
    console.log(typeof t);
    console.log(moment(new Date()).format("YYYY-MM-DD HH:mm:ss"));
    console.log(moment(new Date()).add(7,"day").format("YYYY-MM-DD HH:mm:ss"));
    console.log(moment(new Date()).subtract(7,"day").format("YYYY-MM-DD HH:mm:ss"));

    console.log(moment().format("YYYY-MM-DD HH:mm:ss"));

</script>
</body>
</html>